{% extends 'store/base.html' %}

{% block page %}

    <div class="panel">
        <div class="panel-heading bg-blue">
            <h4 class="panel-title text-center text-white">Tasks</h4>
        </div>
        <div class="panel-body">
            <br/>
            <table class="table table-bordered table-hover table-striped">
                <thead>
                  <tr class="bg-gray text-white">
                    <th>Id</th>
                    <th>Title</th>
                    <th>Preiority</th>
                    <th>Status</th>
                    <th>Delivery Boy</th>
                    <th>Created</th>
                    <th>Accepted</th>
                  </tr>
                </thead>
                <tbody>
                    {% for order in orders %}
                        <tr>
                            <td scope="row">{{ order.id }}</td>
                            <td>
                              {% for od in order.order_details.all %}
                                  {{ od.meal.name }} {{ od.meal.price }}
                                  x {{ od.quantity }} = ${{ od.sub_total }}
                              {% endfor %}
                            </td>
                            <td>{{ order.customer }}</td>
                            <td>{{ order.driver }}</td>
                            <td>{{ order.total }}</td>
                            <td>{{ order.get_status_display }}</td>
                            
                        </tr>
                    {% endfor %}

                </tbody>
            </table>
        </div>
    </div>

{% endblock %}
